package com.kksoft.readcm.b;

import android.content.SharedPreferences;
import com.kksoft.readcm.a.Appconfig;
import com.kksoft.readcm.a.ag;
import com.kksoft.readcm.a.ItemAppObservable;
import com.kksoft.readcm.a.y;
import com.kksoft.readcm.activity.App;
import com.kksoft.readcm.objects.b;
import com.kksoft.readcm.objects.j;
import com.kksoft.readcm.objects.l;
import com.kksoft.readcm.objects.m;
import com.kksoft.readcm.objects.q;
import com.kksoft.readcm.objects.w;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;

public final class k extends f
{
  private String s;
  private int t;
  private boolean u = false;
  private String v;
  private boolean w = false;

  public k(int paramInt1, int paramInt2, y paramy, l paraml, boolean paramBoolean1, boolean paramBoolean2)
  {
    super(paramInt1, paramInt2, paramy, paraml, paramBoolean1);
    this.u = paramBoolean2;
  }

  public k(y paramy, String paramString)
  {
    super(paramy, paramString);
  }

  private void F()
  {
    if ((this.q.get()) || (this.r.get()))
      return;
    if (this.a != null)
    {
      if ((this.s != null) && (this.a.k().length() == 0))
      {
    	  ItemAppObservable locale1 = this.n.s().getItemAppObservable();
        l locall1 = this.a;
        String str1 = this.s;
        locale1.a(locall1, str1, false, true);
      }
      ItemAppObservable locale2 = this.n.s().getItemAppObservable();
      l locall2 = this.a;
      String str2 = this.v;
      locale2.a(locall2, str2);
    }
    //if ((this.t == 0) && (l.S()) && (!this.u) && (this.a != null) && ((this.a.C() != 1) || (this.c)))
    {
      y localy = this.n;
      l locall3 = this.a;
      boolean bool = this.c;
      int i = this.m;
      localy.a(locall3, bool, i);
    }
    Iterator localIterator;
    //if ((App.h().getBoolean("articleImages", 1)) && (App.e().a()) && (this.j != null))
      localIterator = this.j.entrySet().iterator();
    while (true)
    {
      if (!localIterator.hasNext())
      {
        if ((this.e != null) && (this.e.length() > 0))
        {
          String str3 = this.e.replaceAll("(?i)<!--!ENDOFHEADSECTION-->", "<script type='text/javascript' src='file:///android_asset/text.js'></script><link type='text/css' rel='stylesheet' href='file:///android_asset/text.css' /><meta name=\"viewport\" content=\"width=device-width, user-scalable=no\" />");
          this.e = str3;
          if (((this.s == null) || (this.s.length() == 0)) && (this.a.l().length() > 0))
          {
            String str4 = this.e;
            String str5 = this.a.l();
            String str6 = str4.replaceAll("(?i)<!--!THETITLE-->", str5);
            this.e = str6;
          }
        }
        //if ((this.j != null) && (this.j.size() > 0))
          //this.i = 1;
        j();
        break;
      }
      //String str7 = ((q)((Map.Entry)localIterator.next()).getValue()).a();
      Appconfig localaf = D();
      //j localj = j.a(str7, localaf);
      //a(localj, 1);
    }
  }

  protected final void E()
  {
    if (this.a == null)
      this.n.a(this);
  }

  protected final void c()
  {
    super.c();
    if (!this.w)
      this.n.a(this);
    //this.w = 1;
  }

  public final int d()
  {
    return 1;
  }

  protected final void e()
  {
    super.e();
    //if ((this.a == null) && (this.b == null))
      //this.r.set(1);
    while (true)
    {
      return;
//      if (this.a != null)
//      {
//        com.kksoft.readcm.a.c localc1 = this.n.s().e();
//        Integer localInteger = Integer.valueOf(this.a.a());
//        String str1 = localc1.a(localInteger);
//        this.d = str1;
//        continue;
//      }
//      if (this.b == null)
//        continue;
//      com.kksoft.readcm.a.c localc2 = this.n.s().e();
//      String str2 = this.b;
//      String str3 = localc2.a(str2);
//      this.d = str3;
    }
  }

  protected final void g()
  {
    super.g();
//    Appconfig localaf = this.n.s();
//    DefaultHttpClient localDefaultHttpClient = this.n.s().k().a();
//    w localw = new w(localaf, 3, 0, localDefaultHttpClient);
//    String str = this.b;
//    BasicNameValuePair localBasicNameValuePair1 = new BasicNameValuePair("url", str);
//    localw.a(localBasicNameValuePair1);
//    if (this.c)
//    {
//      BasicNameValuePair localBasicNameValuePair2 = new BasicNameValuePair("refresh", "1");
//      localw.a(localBasicNameValuePair2);
//    }
//    c localc = new c(this);
//    localw.a(localc);
//    localw.a();
//    switch (localw.b())
//    {
//    default:
//      if ((localw.c() != 415) && (localw.c() != 413))
//        break;
//      a(0, -1);
//    case 1:
//    }
//    while (true)
//    {
//      return;
//      F();
//      continue;
//      a(0, -1);
//    }
  }

  protected final void h()
  {
    super.h();
    if (((!this.g.get()) || (this.i)) && (!this.q.get()) && (!this.r.get()))
    {
      boolean bool1 = this.o.b();
      //if ((!this.q.get()) && (!this.r.get()))
        //boolean bool2 = this.p.b();
    }
  }

  protected final void i()
  {
    super.i();
    //this.w = 1;
    if (this.a != null)
      this.n.a(this);
    while (true)
    {
      return;
      //this.n.a(this);
    }
  }
}

/* Location:           E:\AndroidDecompiler\jd-gui-0.3.3.windows\newrclasses.dex.dex2jar.jar
 * Qualified Name:     com.kksoft.readcm.b.k
 * JD-Core Version:    0.6.0
 */